]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
notificationDaemon: Emit internal signals only to the shell proxy
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Mon, 29 Jun 2026 15:52:19 +0000 (17:52 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 13 Sep 2026 17:39:10 +0000 (19:39 +0200)
This is following the rationale of 0cbab090, and also applied to the
internal gnome-shell notification service.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4270>
(cherry picked from commit 0e18223332340de430f103571c43732f9d05d9a3)

js/ui/notificationDaemon.js

index 186015cf505290422f87512b9ac0cb44d8f6187a..797100e5d305994c6f89c7151646537db1189533 100644 (file)
@@ -5,6 +5,7 @@ import GObject from 'gi://GObject';
 import Shell from 'gi://Shell';
 
 import * as Config from '../misc/config.js';
+import {emitSignalToDestination} from '../misc/dbusUtils.js';
 import * as Main from './main.js';
 import * as MessageTray from './messageTray.js';
 
@@ -192,7 +193,7 @@ class FdoNotificationDaemon {
                     notificationClosedReason = NotificationClosedReason.UNDEFINED;
                     break;
                 }
-                this._emitNotificationClosed(id, notificationClosedReason);
+                this._emitNotificationClosed(id, notificationClosedReason, invocation);
                 notification.disconnectObject(this);
             });
         }
@@ -222,8 +223,8 @@ class FdoNotificationDaemon {
                     hasDefaultAction = true;
                 } else {
                     notification.addAction(label, () => {
-                        this._emitActivationToken(source, id);
-                        this._emitActionInvoked(id, actionId);
+                        this._emitActivationToken(source, id, invocation);
+                        this._emitActionInvoked(id, actionId, invocation);
                     });
                 }
             }
@@ -231,8 +232,8 @@ class FdoNotificationDaemon {
 
         if (hasDefaultAction) {
             notification.connectObject('activated', () => {
-                this._emitActivationToken(source, id);
-                this._emitActionInvoked(id, 'default');
+                this._emitActivationToken(source, id, invocation);
+                this._emitActionInvoked(id, 'default', invocation);
             }, this);
         } else {
             notification.connectObject('activated', () => {
@@ -297,20 +298,23 @@ class FdoNotificationDaemon {
         ];
     }
 
-    _emitNotificationClosed(id, reason) {
-        this._dbusImpl.emit_signal('NotificationClosed',
+    _emitNotificationClosed(id, reason, invocation) {
+        const sender = invocation.get_sender();
+        emitSignalToDestination(this._dbusImpl, sender, 'NotificationClosed',
             GLib.Variant.new('(uu)', [id, reason]));
     }
 
-    _emitActionInvoked(id, action) {
-        this._dbusImpl.emit_signal('ActionInvoked',
+    _emitActionInvoked(id, action, invocation) {
+        const sender = invocation.get_sender();
+        emitSignalToDestination(this._dbusImpl, sender, 'ActionInvoked',
             GLib.Variant.new('(us)', [id, action]));
     }
 
-    _emitActivationToken(source, id) {
+    _emitActivationToken(source, id, invocation) {
+        const sender = invocation.get_sender();
         const context = global.create_app_launch_context(0, -1);
         const token = context.get_startup_notify_id(null, []);
-        this._dbusImpl.emit_signal('ActivationToken',
+        emitSignalToDestination(this._dbusImpl, sender, 'ActivationToken',
             GLib.Variant.new('(us)', [id, token]));
     }
 }